#ifndef ML_MATRIX_H
#define ML_MATRIX_H

typedef float MLMatrix[16];

extern const float
mlMatrixZero[16], mlMatrixIdentity[16];

void
mlMatrixPrint(const float *a);

void
mlMatrixCopy(const float *a, float *result);

void
mlMatrixLoad(float *x, float a, float b, float c, float d, float e, float f, float g, float h, float i, float j, float k, float l, float m, float n, float o, float p);

void
mlMatrixLoadZero(float *a);

void
mlMatrixLoadIdentity(float *a);

void
mlMatrixAddTo(const float *a, const float *b, float *result);

void
mlMatrixAdd(float *a, const float *b);

void
mlMatrixSubTo(const float *a, const float *b, float *result);

void
mlMatrixSub(float *a, const float *b);

void
mlMatrixMultScalarTo(const float *a, float b, float *result);

void
mlMatrixMultScalar(float *a, float b);

void
mlMatrixMultTo(const float *a, const float *b, float *result);

void
mlMatrixMult(float *a, const float *b);

void
mlMatrixMultVectorTo(const float *a, const float *b, float *result);

void
mlMatrixMultVector(const float *a, float *b);

void
mlMatrixTransposeTo(const float *a, float *result);

void
mlMatrixTranspose(float *a);

void
mlMatrixScaleTo(const float *a, const float *b, float *result);

void
mlMatrixScale(float *a, const float *b);

void
mlMatrixRotateTo(const float *a, const float *axis, float angle, float *result);

void
mlMatrixRotate(float *a, const float *axis, float angle);

void
mlMatrixTranslateTo(const float *a, const float *b, float *result);

void
mlMatrixTranslate(float *a, const float *b);

void
mlMatrixLoadLook(float *a, const float *position, const float *forward, const float *up);

void
mlMatrixLoadLookAt(float *a, const float *eye, const float *center, const float *up);

void
mlMatrixLoadRotation(float *a, const float *forward, const float *up);

void
mlMatrixLoadBillboard(float *a, const float *m, const float *p);

/*
// This four functions need to be redefined and provide a common way to get mainly translation, rotation & scale.
void
mlMatrixGetPosition(const float *a, float *result);

void
mlMatrixGetRight(const float *a, float *result);

void
mlMatrixGetUp(const float *a, float *result);

void
mlMatrixGetForward(const float *a, float *result);
*/

void
mlMatrixLoadTransposedRotation(float *m, const float *r);

void
mlMatrixLoadPositionTransposedRotation(float *m, const float *p, const float *r);

#endif
